package de.szut.traineeslife.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;

public class PreferenceHandler {
	
	private String GOOGLE_ACC_KEY ="googleaccount";
	private Context mContext;
	private SharedPreferences preferences;
	
	/**Save the Base Informsation of the user
	 * @param context
	 */
	public PreferenceHandler(Context context){
		mContext = context;
		preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
	}
	

	public SharedPreferences getPreferences(){
		if(preferences.contains(GOOGLE_ACC_KEY)){
		return preferences;
		}
		return null;	
	}
	
	public void saveGoogleAcc(String accountName){
		preferences.edit().putString(GOOGLE_ACC_KEY,accountName).commit();
	}
	
	public String getPREFS_KEY() {
		return GOOGLE_ACC_KEY;
	}
	
	public void setPREFS_KEY(String pREFS_KEY) {
		GOOGLE_ACC_KEY = pREFS_KEY;
	}
}
